home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 16
/
AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso
/
pd
/
anwendungen
/
amicad
/
arexx_english
/
conv2meta.amicad
< prev
next >
Wrap
Text File
|
1998-08-09
|
3KB
|
130 lines
/* Converts the current document under the META format, then
converts it at the requested format using MetaView.
Version 1.01e (c) R.Florac, 9 août 1998 */
METAVIEW = 'Work:MetaView/MetaView'
options results
SIGNAL ON FAILURE
signal on error
signal on syntax
APLPORT = ADDRESS()
'SAVE("RAM:AmiCAD.FILE")'
fichier="RAM:AmiCAD.META"
'TITLE("Conversion to META format in progress...")'
ADDRESS COMMAND
'Work:AmiCAD/AmiCAD2META' || " RAM:AmiCAD.FILE TO " || '"'fichier'"' ||" FORCE QUIET LIBS=Work:AmiCAD/Bibliothèques"
do NUMBER = 0 to 20
if (SHOW(PORTS,"METAVIEW." || NUMBER) = 0) then
leave
end
/*
** Searching for MetaView: 1. our path above,
** 2. path in env:MetaView.path
** or 3. you must have a assign "MetaView:"
*/
if (EXISTS(METAVIEW)=0) then do
if OPEN("MVVAR","env:MetaView.path","Read") then do
METAVIEW = READLN("MVVAR")
end
if (EXISTS(METAVIEW)=0) then do
METAVIEW = "MetaView:MetaView"
end
end
/*
** Enable warnings for WaitForPort
*/
OPTIONS FAILAT 5
ADDRESS COMMAND
"run " || METAVIEW || " NODISPLAY"
MVPORT = "METAVIEW." || NUMBER
"WaitForPort " || MVPORT
OPTIONS FAILAT 21
ADDRESS(APLPORT)
'TITLE(""):SELECT("Saving format"+CHR(10)+"AMF"+CHR(10)+"WMF"+CHR(10)+"DR2D"+CHR(10)+"CGM"+CHR(10)+"GEM"+CHR(10)+"EPS"+CHR(10)+"AI"+CHR(10)+"HPGL"+CHR(10)+"ILBM"+CHR(10)+"META")'
CHOICE = result
if result>0 then do
extension.1 = "AMF"
extension.2 = "WMF"
extension.3 = "DR2D"
extension.4 = "CGM"
extension.5 = "GEM"
extension.6 = "EPS"
extension.7 = "AI"
extension.8 = "HPGL"
extension.9 = "ILBM"
extension.10= "META"
'REQFILE("Destination 'extension.CHOICE' file?","RAM:")'
FILENAME=result
if FILENAME~="" then do
if POS(extension.CHOICE,FILENAME)=0 then FILENAME=FILENAME||"."||extension.CHOICE
FILENAME='"'||FILENAME||'"'
ADDRESS VALUE MVPORT
LOAD fichier
select
when CHOICE = 1 then do
SAVE FILENAME AS AMF
end
when CHOICE = 2 then do
SAVE FILENAME AS WMF
end
when CHOICE = 3 then do
SAVE FILENAME AS DR2D
end
when CHOICE = 4 then do
SAVE FILENAME AS CGM
end
when CHOICE = 5 then do
SAVE FILENAME AS GEM
end
when CHOICE = 6 then do
SAVE FILENAME AS EPS
end
when CHOICE = 7 then do
SAVE FILENAME AS AI
end
when CHOICE = 8 then do
SAVE FILENAME AS HPGL
end
when CHOICE = 9 then do
SAVE FILENAME AS ILBM
end
otherwise do
ADDRESS COMMAND
'c:copy' " RAM:AmiCAD.META TO "||FILENAME
end
end
end
end
fin:
ADDRESS COMMAND
'c:delete' " RAM:AmiCAD.FILE RAM:AmiCAD.META QUIET"
ADDRESS(APLPORT)
'TITLE("")'
EXIT
FAILURE:
syntax:
erreur=RC
ADDRESS(APLPORT)
'MESSAGE("Script Conv2META"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
ADDRESS(APLPORT)
'MESSAGE("Script Conv2META"+CHR(10)+"Error in line 'SIGL'")'
exit